package cn.edu.ncut.cs.springboot.springsecuritydemo.service;

import cn.edu.ncut.cs.springboot.springsecuritydemo.entity.Book;
import cn.edu.ncut.cs.springboot.springsecuritydemo.entity.User;
import cn.edu.ncut.cs.springboot.springsecuritydemo.repository.BookRepository;
import cn.edu.ncut.cs.springboot.springsecuritydemo.vo.BookVO;
import cn.edu.ncut.cs.springboot.springsecuritydemo.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

/**
 * ClassName : BookService
 * package : cn.edu.ncut.cs.springboot.springsecuritydemo.service
 * Description :
 *
 * @ Author Dreama
 * @ Creat 2024/12/24 13:53
 * @ Version 1.0
 */
@Service
public interface BookService {

//    @Autowired
//    private BookRepository bookRepository;
//
//    public List<Book> getAllBooks(){
//        return bookRepository.findAll();
//    }
//    public Book saveBook(Book book){
//        return bookRepository.save(book);
//    }
        List<BookVO> findAll();

        Optional<Book> getByTitle(@NonNull String title);

        boolean create(@NonNull BookVO bookVO);
        Book getById(@NonNull Long id);
        Book saveBook(Book book);
}
